package org.gw.ylc.base.repositories;

import org.gw.ylc.base.model.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface TeacherRepository extends CrudRepository<Teacher, String> {

	@Query("from Teacher t where (?1 is null or t.name like ?1) and (?2 is null or t.employeeNo like ?2) and (?3 is null or t.department.id=?3)")
	public Page<Teacher> query(String name, String employeeNo, String department, Pageable pageable);

	@Query("from Teacher t where t.employeeNo = ?1")
    Teacher fingByGh(String gh);
}
